Skip to content

Better support for custom directives #825

Closed
rwysocki-equinix wants to merge 2 commits intoCode-Hex:mainfrom
rwysocki-equinix:main
Closed

Better support for custom directives #825
rwysocki-equinix wants to merge 2 commits intoCode-Hex:mainfrom
rwysocki-equinix:main

Conversation

@rwysocki-equinix
Copy link
Copy Markdown

  • Add support for directives without arguments like @required()
  • Add support for custom directive mapping

Closes #422 , #781

* Add support for directives without arguments like `@required()`
* Add support for custom directive mapping

Closes Code-Hex#422, Code-Hex#781
Comment thread tests/directive.spec.ts
Comment on lines -47 to -74
describe('formatDirectiveObjectArguments', () => {
const cases: {
name: string
arg: DirectiveObjectArguments
want: FormattedDirectiveObjectArguments
}[] = [
{
name: 'normal',
arg: {
uri: 'url',
email: 'email',
},
want: {
uri: ['url', '$2'],
email: ['email', '$2'],
},
},
{
name: 'contains array',
arg: {
startWith: ['matches', '/^$2/'],
email: 'email',
},
want: {
startWith: ['matches', '/^$2/'],
email: ['email', '$2'],
},
},
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is important to maintain backward compatibility. Where have these test cases gone? I would like to see them restored if possible.

Copy link
Copy Markdown
Owner

@Code-Hex Code-Hex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the direction is good and it would be helpful if you could respond to the comments.

@Code-Hex Code-Hex closed this Sep 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Allow functions in directive parameters

2 participants